agora inbox for [email protected]  
help / color / mirror / Atom feed
SQL/PSM implemenation for PostgreSQL (roadmap)
971+ messages / 5 participants
[nested] [flat]

* SQL/PSM implemenation for PostgreSQL (roadmap)
@ 2006-12-04 12:09 Pavel Stehule <[email protected]>
  2006-12-06 15:02 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Peter Eisentraut <[email protected]>
  2006-12-06 16:47 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Jonah H. Harris <[email protected]>
  0 siblings, 2 replies; 971+ messages in thread

From: Pavel Stehule @ 2006-12-04 12:09 UTC (permalink / raw)
  To: pgsql-hackers

Hello,

I am work on implementation of SQL/PSM language for PostgreSQL. You can see 
first results on http://postgresql.interweb.cz/index.php/SQL/PSM . My goal 
is creating of referential implementation and using it mainly for education 
and colecting informations about language (documentation, regress tests, 
...). Implementation is based on plpgsql runtime. I haven't necessary 
knowleages for total rewriting any language runtime, and current runtime is 
sufficient for my goals. I don't belive so rewriting runtime can has 
adequate benefit. Runtime can be lighter and cleaner only with some support 
in core. It's reason so this project is external pgfoundry project.

This implementation has PostgreSQL specific. Don't support procedures and 
CALL statement. Don't support unbounded SELECTs. Don't support NOT ATOMIC 
block. More on
http://postgresql.interweb.cz/index.php/SQL/PSM

Roadmap:
  * implement completed functionality (two weeks)
  * testing and cleaning (regress tests) (february)
  * documentation (april)

I welcome any helpers, help, testers, suggestions, notes and comments.

Best regards
Pavel Stehule

_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com. 
http://www.msn.cz/




^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM implemenation for PostgreSQL (roadmap)
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
@ 2006-12-06 15:02 ` Peter Eisentraut <[email protected]>
  2006-12-06 21:25   ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  1 sibling, 1 reply; 971+ messages in thread

From: Peter Eisentraut @ 2006-12-06 15:02 UTC (permalink / raw)
  To: pgsql-hackers; +Cc: Pavel Stehule <[email protected]>

Am Montag, 4. Dezember 2006 13:09 schrieb Pavel Stehule:
> I am work on implementation of SQL/PSM language for PostgreSQL.

Do you have an analysis of the differences between PL/pgSQL and SQL/PSM?  It 
seems they might be variants of the same language rather than separate 
implementations, but no one knows for sure.

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM implemenation for PostgreSQL (roadmap)
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-06 15:02 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Peter Eisentraut <[email protected]>
@ 2006-12-06 21:25   ` Pavel Stehule <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Pavel Stehule @ 2006-12-06 21:25 UTC (permalink / raw)
  To: [email protected]; pgsql-hackers


>Am Montag, 4. Dezember 2006 13:09 schrieb Pavel Stehule:
> > I am work on implementation of SQL/PSM language for PostgreSQL.
>
>Do you have an analysis of the differences between PL/pgSQL and SQL/PSM?  
>It
>seems they might be variants of the same language rather than separate
>implementations, but no one knows for sure.

Some changes are cosmetic, and some not. You can see on current sql/psm 
runtime rewriting gram.y and minimal changes in other files. But this 
languages are really different. The mayor difference is in exception 
handling. The idea is total different.

Individual chapter is sql/psm procedures and unbounded select. SQL/PSM 
propably don't need it, but current implementations support it. This has 
deeper reasons, one is different concept of return output sets in Oracle and 
Sybase based databases. I like this concept (unbounded selects) but it isn't 
part of sql/psm and it isn't current topic.

What I had to solve. In sql/psm is sqlstate more important and designates 
level of error. In Postgresql sqlstate and error level are independent. 
Next, I can solve exception and warnings in sql/psm 3 diffirent ways. 
PostgreSQL and (PL/SQL) can handle only exception in one way. I belive so 
some procedures, can be shared, but current runtime use global variables 
which break sharing.

Other are similar (semantic), but s syntax is total different. Please, see 
syntax for declare variables. I don't know history about SQL/PSM (know it 
anybody?) and I don't know why is sql/psm different from pl/sql. Older 
version of sql/psm was similar to oracle's language.

Every RDBMS supports only subset of SQL/PSM (some parts are unspecified). 
Its main goal for me for now - create referential implementation. Next steps 
are far. You can belive, I can spent long time in searching of any sources 
for sql/psm. One is only and it is ISO/IEC 9075-4.

Best regards

Pavel Stehule

_________________________________________________________________
Najdete si svou lasku a nove pratele na Match.com. http://www.msn.cz/




^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM implemenation for PostgreSQL (roadmap)
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
@ 2006-12-06 16:47 ` Jonah H. Harris <[email protected]>
  2006-12-06 23:04   ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-17 09:46   ` SQL/PSM prototype is available Pavel Stehule <[email protected]>
  1 sibling, 2 replies; 971+ messages in thread

From: Jonah H. Harris @ 2006-12-06 16:47 UTC (permalink / raw)
  To: Pavel Stehule <[email protected]>; +Cc: pgsql-hackers

On 12/4/06, Pavel Stehule <[email protected]> wrote:
> I am work on implementation of SQL/PSM language for PostgreSQL.

Pavel,

I'd be glad to help ya on it.  If you could let me know what you'd
like me to work on, I'd be glad to start.

-- 
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 3rd Floor            | [email protected]
Iselin, New Jersey 08830            | http://www.enterprisedb.com/



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM implemenation for PostgreSQL (roadmap)
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-06 16:47 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Jonah H. Harris <[email protected]>
@ 2006-12-06 23:04   ` Pavel Stehule <[email protected]>
  2006-12-08 04:31     ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Josh Berkus <[email protected]>
  1 sibling, 1 reply; 971+ messages in thread

From: Pavel Stehule @ 2006-12-06 23:04 UTC (permalink / raw)
  To: [email protected]; +Cc: pgsql-hackers

>On 12/4/06, Pavel Stehule <[email protected]> wrote:
>>I am work on implementation of SQL/PSM language for PostgreSQL.
>
>Pavel,
>
>I'd be glad to help ya on it.  If you could let me know what you'd
>like me to work on, I'd be glad to start.
>

Nice, thank you. I plan so in next week finish prototype on 80% (all 
important, moustly error handling). Then you can clean and synchronise code 
with me (gram.y use sql/psm domain names and others still pl/pgsql names).

I am not able write documentation (my english is really stupid). Please, if 
you can, work on it. And, please, read and correct wiki 
(http://postgresql.interweb.cz/index.php/SQL/PSM ). I inwite any notes to 
implementation sql/psm in postgresql environment.

What is your pgfoundry account? Next talks can be on 
plpsm-devel.pgfoundry.org or via ICQ: 138 051 654

Regards
Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. 
http://messenger.msn.cz/




^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM implemenation for PostgreSQL (roadmap)
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-06 16:47 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Jonah H. Harris <[email protected]>
  2006-12-06 23:04   ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
@ 2006-12-08 04:31     ` Josh Berkus <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Josh Berkus @ 2006-12-08 04:31 UTC (permalink / raw)
  To: Pavel Stehule <[email protected]>; +Cc: [email protected]; pgsql-hackers

Pavel,

> I am not able write documentation (my english is really stupid). Please, 
> if you can, work on it. And, please, read and correct wiki 
> (http://postgresql.interweb.cz/index.php/SQL/PSM ). I inwite any notes 
> to implementation sql/psm in postgresql environment.

I'd suggest writing documentation in Czech and getting it translated. 
We probably have more translators than people who know anything about 
PSM.  A lot of the Sun database team is Czech; I can ask if they want to 
help.

--Josh



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* SQL/PSM prototype is available
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-06 16:47 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Jonah H. Harris <[email protected]>
@ 2006-12-17 09:46   ` Pavel Stehule <[email protected]>
  2006-12-17 14:24     ` Re: SQL/PSM prototype is available Jonah H. Harris <[email protected]>
  1 sibling, 1 reply; 971+ messages in thread

From: Pavel Stehule @ 2006-12-17 09:46 UTC (permalink / raw)
  To: [email protected]; +Cc: pgsql-hackers

Hello,

Now, you can test prototype or work on it. All details are on 
http://postgresql.interweb.cz/index.php/SQL/PSM
. This version needs patched core files 
http://postgresql.interweb.cz/index.php/SQL/PSM#Patches_for_core
You can find supported functionality on 
http://postgresql.interweb.cz/index.php/SQL/PSM#Supported_statements .

Next week I should work on "for" and "get diagnostic" stmts implementation. 
There is a lot of work (please see ToDo and Errors sections). It's can be 
success if in you plpgpsm interpret will run. I plan take full functionality 
first and clean and refactorise source  code later.

Dificult part is exception handling :-(, because all postgresql stored 
rutines have to run under transaction, which standard doesn't expect.

Please, use code from CVS.

Best regards
Pavel Stehule

_________________________________________________________________
Emotikony a pozadi programu MSN Messenger ozivi vasi konverzaci. 
http://messenger.msn.cz/




^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* Re: SQL/PSM prototype is available
  2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
  2006-12-06 16:47 ` Re: SQL/PSM implemenation for PostgreSQL (roadmap) Jonah H. Harris <[email protected]>
  2006-12-17 09:46   ` SQL/PSM prototype is available Pavel Stehule <[email protected]>
@ 2006-12-17 14:24     ` Jonah H. Harris <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Jonah H. Harris @ 2006-12-17 14:24 UTC (permalink / raw)
  To: Pavel Stehule <[email protected]>; +Cc: pgsql-hackers

On 12/17/06, Pavel Stehule <[email protected]> wrote:
> Now, you can test prototype or work on it.

Cool.  Good work Pavel.  I'll play with it and some of my PSM code.
I'll try and contact you via IM as to things I'd like to help with.


-- 
Jonah H. Harris, Software Architect | phone: 732.331.1324
EnterpriseDB Corporation            | fax: 732.331.1301
33 Wood Ave S, 3rd Floor            | [email protected]
Iselin, New Jersey 08830            | http://www.enterprisedb.com/



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread

* [PATCH v44 06/10] rename routines on the logical output plugin side
@ 2026-03-23 20:37 Álvaro Herrera <[email protected]>
  0 siblings, 0 replies; 971+ messages in thread

From: Álvaro Herrera @ 2026-03-23 20:37 UTC (permalink / raw)

---
 src/backend/commands/cluster.c                |  3 +-
 .../pgoutput_repack/pgoutput_repack.c         | 54 +++++++++----------
 2 files changed, 29 insertions(+), 28 deletions(-)

diff --git a/src/backend/commands/cluster.c b/src/backend/commands/cluster.c
index b86e600af41..75556cbdafb 100644
--- a/src/backend/commands/cluster.c
+++ b/src/backend/commands/cluster.c
@@ -3121,7 +3121,8 @@ restore_tuple(BufFile *file, Relation relation, TupleTableSlot *slot)
 
 	/*
 	 * Next, read any attributes we stored separately into the tts_values
-	 * array elements expecting them, if any.  This matches store_change.
+	 * array elements expecting them, if any.  This matches
+	 * repack_store_change.
 	 */
 	BufFileReadExact(file, &natt_ext, sizeof(natt_ext));
 	if (natt_ext > 0)
diff --git a/src/backend/replication/pgoutput_repack/pgoutput_repack.c b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
index de1892ef423..032fbd0e5b0 100644
--- a/src/backend/replication/pgoutput_repack/pgoutput_repack.c
+++ b/src/backend/replication/pgoutput_repack/pgoutput_repack.c
@@ -19,32 +19,32 @@
 
 PG_MODULE_MAGIC;
 
-static void plugin_startup(LogicalDecodingContext *ctx,
+static void repack_startup(LogicalDecodingContext *ctx,
 						   OutputPluginOptions *opt, bool is_init);
-static void plugin_shutdown(LogicalDecodingContext *ctx);
-static void plugin_begin_txn(LogicalDecodingContext *ctx,
+static void repack_shutdown(LogicalDecodingContext *ctx);
+static void repack_begin_txn(LogicalDecodingContext *ctx,
 							 ReorderBufferTXN *txn);
-static void plugin_commit_txn(LogicalDecodingContext *ctx,
+static void repack_commit_txn(LogicalDecodingContext *ctx,
 							  ReorderBufferTXN *txn, XLogRecPtr commit_lsn);
-static void plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-						  Relation rel, ReorderBufferChange *change);
-static void store_change(LogicalDecodingContext *ctx, Relation relation,
-						 ConcurrentChangeKind kind, HeapTuple tuple);
+static void repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+								  Relation rel, ReorderBufferChange *change);
+static void repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+								ConcurrentChangeKind kind, HeapTuple tuple);
 
 void
 _PG_output_plugin_init(OutputPluginCallbacks *cb)
 {
-	cb->startup_cb = plugin_startup;
-	cb->begin_cb = plugin_begin_txn;
-	cb->change_cb = plugin_change;
-	cb->commit_cb = plugin_commit_txn;
-	cb->shutdown_cb = plugin_shutdown;
+	cb->startup_cb = repack_startup;
+	cb->begin_cb = repack_begin_txn;
+	cb->change_cb = repack_process_change;
+	cb->commit_cb = repack_commit_txn;
+	cb->shutdown_cb = repack_shutdown;
 }
 
 
 /* initialize this plugin */
 static void
-plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
+repack_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 			   bool is_init)
 {
 	ctx->output_plugin_private = NULL;
@@ -55,13 +55,13 @@ plugin_startup(LogicalDecodingContext *ctx, OutputPluginOptions *opt,
 	if (ctx->output_plugin_options != NIL)
 	{
 		ereport(ERROR,
-				(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
-				 errmsg("This plugin does not expect any options")));
+				errcode(ERRCODE_INVALID_PARAMETER_VALUE),
+				errmsg("this plugin does not expect any options"));
 	}
 }
 
 static void
-plugin_shutdown(LogicalDecodingContext *ctx)
+repack_shutdown(LogicalDecodingContext *ctx)
 {
 }
 
@@ -75,13 +75,13 @@ plugin_shutdown(LogicalDecodingContext *ctx)
 
 /* BEGIN callback */
 static void
-plugin_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
+repack_begin_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn)
 {
 }
 
 /* COMMIT callback */
 static void
-plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+repack_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				  XLogRecPtr commit_lsn)
 {
 }
@@ -90,8 +90,8 @@ plugin_commit_txn(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * Callback for individual changed tuples
  */
 static void
-plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
-			  Relation relation, ReorderBufferChange *change)
+repack_process_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
+					  Relation relation, ReorderBufferChange *change)
 {
 	RepackDecodingState *private = (RepackDecodingState *) ctx->output_writer_private;
 
@@ -114,7 +114,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (newtuple == NULL)
 					elog(ERROR, "incomplete insert info.");
 
-				store_change(ctx, relation, CHANGE_INSERT, newtuple);
+				repack_store_change(ctx, relation, CHANGE_INSERT, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_UPDATE:
@@ -129,9 +129,9 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 					elog(ERROR, "incomplete update info.");
 
 				if (oldtuple != NULL)
-					store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
+					repack_store_change(ctx, relation, CHANGE_UPDATE_OLD, oldtuple);
 
-				store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
+				repack_store_change(ctx, relation, CHANGE_UPDATE_NEW, newtuple);
 			}
 			break;
 		case REORDER_BUFFER_CHANGE_DELETE:
@@ -143,7 +143,7 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
 				if (oldtuple == NULL)
 					elog(ERROR, "incomplete delete info.");
 
-				store_change(ctx, relation, CHANGE_DELETE, oldtuple);
+				repack_store_change(ctx, relation, CHANGE_DELETE, oldtuple);
 			}
 			break;
 		default:
@@ -172,8 +172,8 @@ plugin_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
  * replication identity instead of the full tuple.
  */
 static void
-store_change(LogicalDecodingContext *ctx, Relation relation,
-			 ConcurrentChangeKind kind, HeapTuple tuple)
+repack_store_change(LogicalDecodingContext *ctx, Relation relation,
+					ConcurrentChangeKind kind, HeapTuple tuple)
 {
 	RepackDecodingState *dstate;
 	MemoryContext	oldcxt;
-- 
2.47.3


--gwom7bl7ogtszo4k
Content-Type: text/x-diff; charset=utf-8
Content-Disposition: attachment;
	filename="v44-0007-Split-cluster.h-to-create-repack_internal.h.patch"



^ permalink  raw  reply  [nested|flat] 971+ messages in thread


end of thread, other threads:[~2026-03-23 20:37 UTC | newest]

Thread overview: 971+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-12-04 12:09 SQL/PSM implemenation for PostgreSQL (roadmap) Pavel Stehule <[email protected]>
2006-12-06 15:02 ` Peter Eisentraut <[email protected]>
2006-12-06 21:25   ` Pavel Stehule <[email protected]>
2006-12-06 16:47 ` Jonah H. Harris <[email protected]>
2006-12-06 23:04   ` Pavel Stehule <[email protected]>
2006-12-08 04:31     ` Josh Berkus <[email protected]>
2006-12-17 09:46   ` SQL/PSM prototype is available Pavel Stehule <[email protected]>
2006-12-17 14:24     ` Re: SQL/PSM prototype is available Jonah H. Harris <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro Herrera <[email protected]>
2026-03-23 20:37 [PATCH v44 06/10] rename routines on the logical output plugin side Álvaro 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